# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>

_pkg=GnuPG-Interface
pkgname=perl-${_pkg,,}
pkgver=1.02
pkgrel=4
pkgdesc="Object-oriented methods for interacting with GnuPG"
arch=('any')
url="https://metacpan.org/release/${_pkg}"
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('gnupg' 'perl-math-bigint' 'perl-moo' 'perl-moox-handlesvia' 'perl-moox-late')
makedepends=('perl-module-install')
source=("https://cpan.metacpan.org/authors/id/B/BP/BPS/${_pkg}-${pkgver}.tar.gz")
sha512sums=('ff4365aa75fbcd2dc77c915ec36c0b578219ae1a2148e936b4769221f91c78a3bc3d371159b5130e7bee36ecf0e169b6a16e3a160d2598811d6f70850119f6e4')

build() {
    cd ${_pkg}-${pkgver}
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd ${_pkg}-${pkgver}
    # 19 tests failing, likely because we are in a chroot
    make test
}

package() {
    cd ${_pkg}-${pkgver}
    make INSTALLDIRS=vendor DESTDIR="$pkgdir" install
}
